Added create and edit functions