fixing some bugs that came up