Fix bug on permission