added more error handling, more conversastion