removed some NullPointerExceptions