Fix bug in edit view