Cleaned code up a bit and added Toast popups if error occurs