fix bug that made it not work