add offsetTopBar and bugfix