Add proper check before appending to PYTHONPATH