-Added null check