Added some type logic