fixed defects from Xcode