fix bug in booking counts sql