make return int to fix read