working version 4 : minor bug fix