fixed compilation bugs with xcode 6