fix permissions hook