repaired the post function