apply boundary condition also for magnetic potential