make sure variable requestsbefore is defined