used dirname instead of __file__