fix for negative coordinates problem