declare before defining to fix compile error