Fixed not correctly checking permission