changed callback to setTimeout