some updates to doPost() method