fixed bug with trailing separator