Added check for input result