fix compilation under linux
fixed crashy code!