bit mask bug fixed