fixed a bug with editing