Adding some checking