defensive programming hw added