Fix naming issuesand add eventlistener instead of onclick