Detail view is resetting properly when app goes to background