updated code for post