added checkCondition and a bit of logic in BeSmart