add loggin control