implemented loggin