bug fixin and processing