Cleaned button, added some error handling