fixed a bug in function call()