Edit function is now working