making code work with older appcelerator implementations