Fixed crash after pausing the application