added sleep/wake functionality