fixing class cast issue in the debug log