improved change code. doesn't break if user is stupid