Added more checks
mistake