fixes build and readded null check