update login function and add filter roles