fixed executeUpdate query function, moved exports fuctions to bottom of script