javascript check if object is not defined