better exec function