Fixing function call error