fixed infinite loop issue when less than 4 projects were in the db