fix compile error - needs more testing