changed function definition