Switched int flag to type BOOL