fixes undefined issue