added better constructor checks