fixed some jQuery bugs