Check the type of an object instead for instanceof Object