fixed introduced bugs, hopefully