added hex conversion

- added hex conversion
- added error handling accordingly