added type string conversion, as well as fixed id bug