correct closure&array callbacks handling