fixed broken edit and update methods