bug fix and formated