Man dies while in custody