Change behaviour of setOnloadCallback