Fixed onBind function