need to link with pthread library