Added form tag instead of simple div
Added some check in check function