Added null check