added error handling and django forms