return error instead of bool