made code safer