added couple checks