implemented idle functionality