fixed multiple functions
created function reference for event instead of inline
fixed onclick functions