bugfix prevents a couple of exceptions