fixed some bugs after testing with laptop