fixing the cancel buttons to redirect back