some error handling and remove headers button now works