works with error message added