change return to function