Exception handled for input row or column str