Bug fix #521 Fix margin bug

Issue #521 
@MohamedBassem