avoid nil pointer error