Fixed edit functionality.
last few changes