added throw exception when negative number