add helper func for errors