corrected to make it compilable in Ubuntu