Added simple sid boundery check