fixing some bugs on deploy