error handling bugfix, improve express config