no need of elseif if return above.

Just do 
if (...) {
    return;
}

if (...) {
    return;
}