finally got this working