Added !isFinishing() check