added exception handling for non-integer inputs