use getString instead of getBytes
remove unnecessary code