Fixed a bug with the casting on the OnClick method.