Added close_input() function to exec() returns'