added sleep feature