Just check the last character without using endswith