-1 to in_data, need to implement semaphore to global vars

Signed-off-by: degrigis <fbi.gritti@gmail.com>