Not using function.bind since it is not supported by iOS6