null checks added