added code to only detach when idle for 15 secs