Moved form to the center. Add some error handling