not sure why this is throwing an undefined