Fixed error messages bug