fixed the undefined issue :)