added improved security
adding error column to know the last error