added state tracking to try and emulate an idle time function