had deleted wrong version of function, fixed now