fix code a bit