fixed one of the functions