Fixing entry check for correctness