fixed bug with empty goal