find_last_of is wrong, we actually want rfind here