trying to fix smooth undefined