fixed bugs due to missing data