bug fixed, functionally right