iOS Freezing on certain functions.