removed debugger and fixed function call