modifying fix as per max's request