Changed sys call to lib function