fixes undefined property errors