check for trailing separator before adding