bug in if statements (using string instead of string_tmp)