Adding security to hook