fixed unnoticeable bug with debug mode.