now with minor bug fixed