created update and create functions