fix code for late binding