add edit and update functions