fixes datatype issue and changes out-of-bounds to -128