Fix post code location function