inefficient fix but it works