changed typeof() call to type()

Don't understand why you call typeof(), instead I changed it to type(). Couldn't get it to work using typeof()