#311 - fixing another bug. adding error messages