don't forget to set $tmpInput