merge
Rewrite authentication
bug fix