adding an error handler for unauthorized requests