fix error redirect for admin permissions hook