Make sure output is correctly redirected