modification to fix issue that prevented the code from running in ios 5.0