Reduced number of previous queries and fixed issue when doing time frame search and having year arrived with slaves open