Edit and delete functions fixed