added migration and corrected some compilation iss