Hi!. The Insert code at head is not working Properly

When i Continuously Input insert at head. It is Taking the first 2 Inputs as a Place. Hence the Insert Middle Function is Not working Properly. Please Help me

send the link of code
please don’t paste your code here