added error handling of move