minor changes (error handling)