bugfix null checks