Revert "add check fro end of mem"

This reverts commit 6c4c8eb5c95293aea2daaf07adb7f59b113faa0c.