Adding err management