addind logging in functionality