fixed __dir__ error and possibly string format error