changed type method to setType