Fixed typo
Fixed permission check