changing function in  div and correcting the minetype