fix validator and add post function