removing rest,  changing sql for open  and close

removing rest,  changing sql for open  and close