updated to have active and idle states