added item for csrf, fixed bugs in lib