Add error handling to crud and warn if user navigates without save