Fix key error
Fix error handler