fixed a bug in edit widget