fixes nasty bug. Thanks teihoo!