added error handling when no level is selected to edit