Fixing crashes when using the home-button