minor fixes, removed bugs in logic
added callback when frame is parsed