Database fix
Added error method