fixed attribute error 'None doesn`t have attr'