fixed bug in atlas generation