fixing edit handler bugs