fixed bug getting errors