some error message and handling fine tuning