Added error checking to converter