possible fix for #20, instead of custom function from stackoverflow use wrap one from apache commons