fix major bugs, add expanded button, add error messages