added update function
corrected redirect bug with delete