added query for last failures of a build