Working, but shuts down after a while for no reason (no exception is thrown).