fixed intended bugs