added logining