Fixed small style issue
Fixed attachment permission check