latest changes including 508 fixes and compatible handler code