fixed assembly and improved error handling