fixed bugs related to telling if agent was available or not