Fixed a bug to Utils.py: when checking for validity return always Boolean