Fixed Class Issue

When i add a class array in add_input function. the class attribute is not printed. its fixed by adding some fixes in this code.
Merge pull request #3 from technofreaky/patch-1

Thanks for your help here, good catch!