Added logic to check whether the input is an integer or a string