replace error() by die()