Fixing behaviour on error