fixed some coding issues