Added null-check to avoid exception