fixing error handling and show hide
merged index conflict