Small changes on permission check