prevent usage of negative numbers as begin and count in range method