Added boolean type checking