fixing new funciton