Fixed a bug with edit