fixed some errors, added post function