working on making this more reliable