added post handler and post code to index