added hook for checking permission