Add better error messaging