Fixed the edit and update issues