fix the form add button
improved error handling
debug