add login authenticate part
fix bugs