working login and count, bugs still exist