[#52246861] bug fix and code clean up