added nil catch