2004 Pontiac Grand Am temp gauge stays cold, but engine revs

2004 Pontiac grand am temp gauge stays at cold , but engine revs up , even more when put in park . Upon restarting engine idles fine?? At a lose ?

Bad thermostat.