fixed faulty function definition
fixed conflicts