add login count and other minor fix