looks like instead of ''find" you could simply check the last symbol