added boundry checms