Changed the check to work for all cases