Added Update and Edit functionality