added a little more error messaging to avoid warnigns