fixing bugs for compiling properly