added slice bounds checking for getInt method