error handling code in thought form post. need to figure out how to debug