added multifile and fixed existing bug