reference error fixed