Add check for errors