remove test function & handle promise side effect