cleaned up doPost a bit