New proposal for using quantum error correction in metrology