Fixed POST issue, fixed logic error in insert