Changed to make hash check not variable type dependant