The misc functions for ios