Add timer to handle close prompt