validation added to check negative integer inputs
validation added to check negative integer inputs