fixed a bug and oversight