minor layout change
Add error detection