Fixed the issue with spaces not being evalulated correclty in loop.