correct place to call this function