fix some issue with ruby conditional statements