move distance database logic from model to resource class
fix broken getListBlock method