fix dynamic class creation on iOS 5