Removed unnecessary check causing NullPointerException