improved class conexion and created class error