fixed bugs, removed contextlog dependency