debug fixing and stuff