chown permission checking working properly