fixed permissions
Log also stderr