fix passing invalid parametrs to flock

fix passing invalid parametrs to flock. issue #51