fixed multi-part function definition bug