fixed nullreference exception in ios project