fixed more boundary issues