Cannot modify header information – headers already sent

You should use the template_redirect action instead of wp_loaded.
It’s a good practice add die(); after wp_redirect() to.