Fix bug in unauthorized_actions throwing exception