removed usage of gettype()