added fixes and comment