use rfind instead of find_last_of

find_last_of isn't the behavior we want