fix a crash and pop af