added some codes before