compile error fix

fixes a error i was sometimes getting during testing