debug the onFrame method