updating return to include err
printing error