fix couple bugs