fix bug with use functions twice